home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Compute! Gazette 1989 April
/
1989-04.d64
/
alarm clock
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
1KB
|
41 lines
10 rem digital alarm clock
15 print"[147]":poke53281,6:poke53280,14:poke646,14
20 fori=49152to49283:reada:x=x+a:pokei,a:nexti:rem poke alarm ml routine
30 ifx<>15756thenprint"data statement error.":stop
40 a$="clock":c=49288:gosub280:a$="alarm":c=49284:gosub280:rem get times
50 sys49152:end:rem set alarm
60 data 169,42,141,24,3,169
70 data 192,141,25,3,173,15
80 data 221,9,128,141,15,221
90 data 160,0,32,102,192,173
100 data 15,221,41,127,141,15
110 data 221,160,4,32,102,192
120 data 169,132,141,13,221,96
130 data 173,13,221,41,4,240
140 data 50,169,4,141,13,221
150 data 32,115,192,169,13,141
160 data 24,212,169,0,141,5
170 data 212,169,240,141,6,212
180 data 169,4,141,1,212,169
190 data 33,141,4,212,32,159
200 data 255,165,198,240,249,32
210 data 115,192,32,126,192,169
220 data 0,133,198,76,71,254
230 data 162,3,185,132,192,157
240 data 8,221,200,202,16,246
250 data 96,169,0,160,24,153
260 data 0,212,136,16,250,96
270 data 120,32,138,255,88,96
280 print"[147]for the "a$" time:"
290 print:input"what is the hour";h$:h=val(h$):ifh<0orh>12then290
300 f=0:input"am or pm";f$:ifleft$(f$,1)="p"thenf=128
310 hn=0:ifh>9thenhn=16
320 hh=val(right$(h$,1)):h=f+hn+hh:pokec+0,h
330 input"what is the minute";m$:m=val(m$):ifm<0orm>59then330
340 mn=0:ifm>9thenmn=16*val(left$(m$,1))
350 mm=val(right$(m$,1)):m=mn+mm:pokec+1,m
360 input"what is the second";s$:s=val(s$):ifs<0ors>59then360
370 sn=0:ifs>9thensn=16*val(left$(s$,1))
380 ss=val(right$(s$,1)):s=sn+ss:pokec+2,s:pokec+3,0:rem secs, tenths of secs
390 return